@extends('layouts.user')
@section('title', '编辑用户基本信息')

@section('lift-contaier')
    <div class="box">
        <div class="padding-md">
            <div class="list-group text-center">
                @include('include.user.nav', ['ac' => 'edit'])
            </div>
        </div>
    </div>
@endsection

@section('right-contaier')
    <div class="panel-body">
        <h2>
            <i class="fa fa-cog" aria-hidden="true"></i> 编辑个人资料</h2>
        <hr>
        <form class="form-horizontal" method="POST" action="{{url('/user/update')}}" accept-charset="UTF-8" enctype="multipart/form-data">
            {{ method_field('PATCH') }}
            {!! csrf_field() !!}
            <div class="form-group">
                <label for="name" class="col-sm-2 control-label">昵称</label>
                <div class="col-sm-6">
                    <input class="form-control" id="name" name="name" type="text" value="{{old('name')==null ? $user->name : old('name')}}" required>
                </div>
                <div class="col-sm-4 help-block">
                    用户昵称
                </div>
                {{errorMsg($errors,'name')}}
            </div>

            <div class="form-group">
                <label for="" class="col-sm-2 control-label">邮 箱</label>
                <div class="col-sm-6">
                    <input class="form-control" name="email" type="text" value="{{old('email')==null ? $user->email : old('email')}}" required>
                </div>
                <div class="col-sm-4 help-block">
                    如：name@website.com
                </div>
                {{errorMsg($errors, 'email')}}
            </div>

            <div class="form-group">
                <label for="" class="col-sm-2 control-label">真实姓名</label>
                <div class="col-sm-6">
                    <input class="form-control" name="truename" type="text" value="{{old('truename')==null ? $user->truename : old('truename')}}">
                </div>
                <div class="col-sm-4 help-block">
                    如：李小明
                </div>
                {{errorMsg($errors,'truename')}}
            </div>

            <div class="form-group">
                <label for="" class="col-sm-2 control-label">城市</label>
                <div class="col-sm-6">
                    <input class="form-control" name="city" type="text" value="{{old('city')==null ? $user->city : old('city')}}">
                </div>
                <div class="col-sm-4 help-block">
                    如：北京、广州
                </div>
                {{errorMsg($errors,'city')}}
            </div>

            <div class="form-group">
                <label for="" class="col-sm-2 control-label">公司</label>
                <div class="col-sm-6">
                    <input class="form-control" name="company" type="text" value="{{old('company')==null ? $user->company : old('company')}}">
                </div>
                <div class="col-sm-4 help-block">
                    如：阿里巴巴
                </div>
                {{errorMsg($errors,'company')}}
            </div>

            <div class="form-group">
                <label for="" class="col-sm-2 control-label">微博用户名</label>
                <div class="col-sm-6">
                    <input class="form-control" name="weiboname" type="text" value="{{old('weiboname')==null ? $user->weiboname : old('weiboname')}}">
                </div>
                <div class="col-sm-4 help-block">
                    微博名称
                </div>
                {{errorMsg($errors,'weiboname')}}
            </div>

            <div class="form-group">
                <label for="" class="col-sm-2 control-label">微博个人页面</label>
                <div class="col-sm-6">
                    <input class="form-control" name="weibourl" type="text" value="{{old('weibourl')==null ? $user->weibourl : old('weibourl')}}">
                </div>
                <div class="col-sm-4 help-block">
                    微博个人主页链接，如：http://weibo.com/*******
                </div>
                {{errorMsg($errors,'weibolink')}}
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2 control-label">个人网站</label>
                <div class="col-sm-6">
                    <input class="form-control" name="weblink" type="text" value="{{old('weblink')==null ? $user->weblink : old('weblink')}}">
                </div>
                <div class="col-sm-4 help-block">
                    如：www.name.com，不需要加前缀 https://
                </div>
                {{errorMsg($errors,'weburl')}}
            </div>

            <div class="form-group">
                <label for="wechat_qrcode" class="col-sm-2 control-label">微信账号二维码</label>
                <div class="col-sm-6">
                    <input type="file" name="wechatqrcode">
                </div>
                <div class="col-sm-4 help-block">
                    你的微信个人账号，或者订阅号
                </div>
                {{errorMsg($errors,'wechatqrcode')}}
            </div>

            <div class="form-group">
                <label for="" class="col-sm-2 control-label">支付二维码</label>
                <div class="col-sm-6">
                    <input type="file" name="paymentqrcode">
                </div>
                <div class="col-sm-4 help-block">
                    文章打赏时使用，微信支付二维码
                </div>
                {{errorMsg($errors,'paymentqrcode')}}
            </div>

            <div class="form-group">
                <label for="" class="col-sm-2 control-label">个人简介</label>
                <div class="col-sm-6">
                    <textarea class="form-control" rows="3" name="introduction" cols="50" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 104px; max-width: 100%">{{$user->introduction}}</textarea>
                </div>
                <div class="col-sm-4 help-block">
                    请一句话介绍你自己，大部分情况下会在你的头像和名字旁边显示
                </div>
                {{errorMsg($errors,'introduction')}}
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-6">
                    <input class="btn btn-primary" id="user-edit-submit" type="submit" value="应用修改">
                </div>
            </div>
        </form>
    </div>
@endsection